package leetcode.easy;

import leetcode.base.TreeNode;

/**
 * ClassName: $226_InvertTree
 * Description: 翻转二叉树
 * date: 2021-11-30 22:01
 *
 * @author liyifan
 */
public class $226_InvertTree {
    public TreeNode invertTree(TreeNode root) {
        if (root == null)
            return null;
        invertTree(root.left);
        invertTree(root.right);
        TreeNode temp = root.left;
        root.left = root.right;
        root.right = temp;
        return root;
    }
}
